<?php
namespace common\enums;

use Yii;


class WhetherEnum
{
    const ENABLED = 1;
    const DISABLED = 0;

    /**
     * @var array
     */
    public static $listExplain = [
        self::ENABLED => '是',
        self::DISABLED => '否',
    ];

    public static function map()
    {
        return [
            self::ENABLED => Yii::t('backend', 'yes'),
            self::DISABLED => Yii::t('backend', 'no'),
        ];
    }

    public static function getEnumStr($enumValue)
    {
        if ($enumValue == self::ENABLED) {
            return Yii::t('backend', 'yes');
        } else if ($enumValue == self::DISABLED) {
            return Yii::t('backend', 'no');
        }
        return '';
    }

}
